package org.makcro.sms.services.chat.base.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;

import org.makcro.sms.services.chat.model.Signature;

public class SignatureDAO extends AbstractDAO<Signature> implements SignatureDao {

	@PersistenceContext
	private EntityManager em;
	
	public SignatureDAO() {
		super(Signature.class);
	}

	@SuppressWarnings("unchecked")
	public List<Signature> findAll() {
		List<Signature> sq = null;
		try {
			sq = (List<Signature>) em.createNamedQuery("Signature.findAll").getResultList();
		} catch (NoResultException e) {

		}

		return sq;
	}
	
	@SuppressWarnings("unchecked")
	public List<Signature> findAllActive() {
		List<Signature> sq = null;
		try {
			sq = (List<Signature>) em.createNamedQuery("Signature.findAllActive").getResultList();
		} catch (NoResultException e) {

		}

		return sq;
	}
}
